package com.andnnl.act.inject;

import com.andnnl.act.inject.MyService;
import org.osgl.mvc.annotation.GetAction;

/**
 * Created by chenss on 2019/12/3.
 */
// Inject the service
public class Serviced {

    // this one will get bind to the default implementation: OneService
    @javax.inject.Inject
    private MyService one;

    // this one will get bind to TwoService
    @javax.inject.Inject
    @javax.inject.Named("two")
    private MyService two;

    @GetAction("testOne")
    public String testOne(){
        one.service();
        return "test one ";
    }

    @GetAction("testTwo")
    public String testTwo(){
        two.service();
        return "test two ";
    }
}